﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:EAppointmentsWPF_Data="clr-namespace:EAppointmentsWPF.Data" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
	xmlns:ea="clr-namespace:EAppointmentsWPF"
	x:Class="EAppointmentsWPF.AppointmentList"
	x:Name="AppointmentListControl"
	Width="Auto" Height="488" Foreground="{x:Null}">

	<UserControl.Resources>
	<ResourceDictionary>

            	<!-- Dictionaries-->
            	<ResourceDictionary.MergedDictionaries>
	                <ResourceDictionary Source="..\Resources\ControlStyles\Brushes.xaml"/>
                	<ResourceDictionary Source="..\Resources\ControlStyles\Buttons.xaml"/>
                	<ResourceDictionary Source="..\Resources\ControlStyles\ComboBox.xaml"/>
                	<ResourceDictionary Source="..\Resources\ControlStyles\CheckBox.xaml"/>
                    <ResourceDictionary Source="..\Resources\ControlStyles\DatePicker.xaml"/>
                	<ResourceDictionary Source="..\Resources\ControlStyles\ListBox.xaml"/>
					<ResourceDictionary Source="..\Resources\ControlStyles\ListView.xaml"/>
                	<ResourceDictionary Source="..\Resources\ControlStyles\Styles.xaml"/>
					<ResourceDictionary Source="..\Resources\ControlStyles\GlyphStyles.xaml"/>
            	</ResourceDictionary.MergedDictionaries>
				
				<ea:StatusToGlyphConverter x:Key="StatusToGlyphConverter" />
	<!--
		<SolidColorBrush x:Key="ControlsBorderBrush" Color="#FF3F74B5"/>
	-->
		<!--
		<ControlTemplate x:Key="ListViewColumnHeaderControlTemplate" TargetType="{x:Type GridViewColumnHeader}">
			<Border SnapsToDevicePixels="True" Height="27" BorderBrush="#FF9FB6C7" BorderThickness="1,1,1,1">
				<Border.Background>
					<LinearGradientBrush EndPoint="0.534,0.98" StartPoint="0.534,0.04">
						<GradientStop Color="#FFFFFFFF" Offset="0"/>
						<GradientStop Color="#FFC2CBDA" Offset="1"/>
						<GradientStop Color="#FFC2CEDF" Offset="0.567"/>
					</LinearGradientBrush>
				</Border.Background>
				<Grid>
					<Microsoft_Windows_Themes:ClassicBorderDecorator x:Name="ContentContainer" BorderStyle="Raised" Width="Auto" Height="Auto" >
						<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" RecognizesAccessKey="True"/>
					</Microsoft_Windows_Themes:ClassicBorderDecorator>
					<Canvas Width="Auto" Height="Auto">
						<Thumb x:Name="PART_HeaderGripper" Background="#00FFFFFF">
							<Thumb.Style>
								<Style TargetType="{x:Type Thumb}">
									<Setter Property="Canvas.Right" Value="-9"/>
									<Setter Property="Width" Value="18"/>
									<Setter Property="Height" Value="{Binding Path=ActualHeight, RelativeSource={RelativeSource TemplatedParent}}"/>
									<Setter Property="Padding" Value="0,3,0,4"/>
									<Setter Property="Background" Value="#FF000000"/>
									<Setter Property="Template">
										<Setter.Value>
											<ControlTemplate TargetType="{x:Type Thumb}">
												<Border Background="#00FFFFFF" Padding="{TemplateBinding Padding}">
													<Rectangle Fill="{TemplateBinding Background}" HorizontalAlignment="Center" Width="1"/>
												</Border>
											</ControlTemplate>
										</Setter.Value>
									</Setter>
								</Style>
							</Thumb.Style>
						</Thumb>
					</Canvas>
				</Grid>
			</Border>
			<ControlTemplate.Triggers>
				<Trigger Property="IsPressed" Value="True">
					<Setter Property="BorderStyle" TargetName="ContentContainer" Value="RaisedPressed"/>
					<Setter Property="BorderThickness" TargetName="ContentContainer" Value="0,0,0,0"/>
					<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
				</Trigger>
				<Trigger Property="Height" Value="Auto">
					<Setter Property="MinHeight" Value="20"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="False">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
	
		<Style x:Key="ListViewColumnHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
			<Setter Property="Template" Value="{DynamicResource ListViewColumnHeaderControlTemplate}"/>
		</Style>
	
		<SolidColorBrush x:Key="DarkBlueFontBrush" Color="#FF1D3453"/>
	-->
	
	<DataTemplate x:Key="StatusGlyph">
	<!--	<ContentControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="15,7,0,0" Width="20" Height="20" Content="ContentControl" VerticalContentAlignment="Center">-->
			<!--<ContentControl.Style>
				<Binding Path="StatusStyle"/>
			</ContentControl.Style>-->
			<ContentControl  Width="22" Height="22" Style="{Binding Statusvalue,Converter={StaticResource StatusToGlyphConverter}}"/>
		<!--</ContentControl>-->
	</DataTemplate>
		<DataTemplate x:Key="UBRNnumber">
	
			<TextBlock TextWrapping="Wrap" Text="{Binding Path=UBRNno}" FontSize="12"/>
		</DataTemplate>
		<DataTemplate x:Key="DateValue">
	
			<TextBlock TextWrapping="Wrap" Text="{Binding Path=Datevalue}" FontSize="12"/>
		</DataTemplate>
	
		<DataTemplate x:Key="ReferrerName">
	
			<TextBlock TextWrapping="Wrap" Text="{Binding Path=ReferrerName}" FontSize="12"/>
		</DataTemplate>
	
		<DataTemplate x:Key="PatientName">
			<TextBlock TextWrapping="Wrap" Text="{Binding Path=PatientName}" FontSize="12"/>
		</DataTemplate>
		<ObjectDataProvider x:Key="PatientsDS" d:IsDataSource="True" ObjectType="{x:Type EAppointmentsWPF_Data:Patients}"/>
	</ResourceDictionary>
	</UserControl.Resources>
	<Grid x:Name="TableGrid" Width="Auto" Margin="0,5,0,0" VerticalAlignment="Stretch" Height="Auto">
		<Border BorderBrush="{DynamicResource ListBorder}" BorderThickness="1,1,1,1" Margin="0,0,0,0">
			<Grid Width="Auto" Height="Auto">
				<Grid.RowDefinitions>
					<RowDefinition Height="0.919*"/>
					<RowDefinition Height="0.081*"/>
				</Grid.RowDefinitions>
				<Grid>
					<ListView Foreground="#FF000000" BorderThickness="2,2,2,2" BorderBrush="{x:Null}" IsSynchronizedWithCurrentItem="True" x:Name="lstView" ItemContainerStyle="{DynamicResource ListViewItemStyle1}" Width="Auto" ButtonBase.Click="GridViewColumnHeaderClickedHandler" SelectionChanged="lstView_SelectionChanged" ItemsSource="{Binding Mode=OneWay, Source={StaticResource PatientsDS}}" Margin="1,1,1,0">
						<ListView.View>
							<GridView>
								<GridViewColumn Width="35"  CellTemplate="{StaticResource StatusGlyph}" HeaderContainerStyle="{DynamicResource ListViewColumnHeaderStyle}" HeaderTemplate="{StaticResource ListViewColumnHeaderTemplate}"/>
								<GridViewColumn Width="95" Header="UBRN" CellTemplate="{StaticResource UBRNnumber}" HeaderContainerStyle="{DynamicResource ListViewColumnHeaderStyle}" HeaderTemplate="{StaticResource ListViewColumnHeaderTemplate}"/>
								<GridViewColumn Width="100" Header="Date" CellTemplate="{StaticResource DateValue}" HeaderContainerStyle="{DynamicResource ListViewColumnHeaderStyle}" HeaderTemplate="{StaticResource ListViewColumnHeaderTemplate}"/>
								<GridViewColumn Width="177" Header="Patient Name" CellTemplate="{StaticResource PatientName}" HeaderContainerStyle="{DynamicResource ListViewColumnHeaderStyle}" HeaderTemplate="{StaticResource ListViewColumnHeaderTemplate}"/>
								<GridViewColumn Width="210" Header="Referrer Name" CellTemplate="{StaticResource ReferrerName}" HeaderContainerStyle="{DynamicResource ListViewColumnHeaderStyle}" HeaderTemplate="{StaticResource ListViewColumnHeaderTemplate}"/>
							</GridView>
						</ListView.View>
					</ListView>
				</Grid>
				<ContentControl x:Name="GlyphyKeyContentControl" Template="{StaticResource GlyphKeyTemplate}" d:LayoutOverrides="Width" Margin="0,1,0,-2" Grid.Row="1"   />
			</Grid>
		</Border>
	</Grid>
	
</UserControl>